﻿using System;
using System.Linq;
using System.Collections.Generic;
using NTTDATA.BEENChina.ResultCertification.Config;

namespace NTTDATA.BEENChina.ResultCertification.Checker.Date
{
    [Serializable]
    [VerfityAttribute(Id = "VerfityRq0302", Name = "各工程多漏录检证(日期部分)", CategoryType = EnumCategoryType.日期, Model = true)]
    public class VerfityRq0302 : VerfityMulitResult
    {
        public override bool CheckResult(List<List<string>> result1, string entryCommon1, List<List<string>> result2, string entryCommon2)
        {
            var resultA = result1.Select(t => t.Select(GetSpecialResult).ToList()).ToList();
            var resultB = result2.Select(t => t.Select(GetSpecialResult).ToList()).ToList();

            return new Verfity0302().CheckResult(resultA, entryCommon1, resultB, entryCommon2);
        }


        private string GetSpecialResult(string colResult)
        {
            var splitResult = new Split.SplitEntryResult(ChildImageObject.CategorySetting.DataFormat, colResult);

            return splitResult.GetDate();
        } 
    }
}